package com.yuyang.gulimall.seckill.controller;

import com.yuyang.common.utils.R;
import com.yuyang.gulimall.seckill.service.SeckillService;
import com.yuyang.gulimall.seckill.to.SecKillSkuRedisTo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yu yang
 * @date 2023/2/13 -19:45
 */
@RestController
public class SeckillController {
    @Autowired
    SeckillService seckillService;

    @GetMapping("/getInfo/seckillSku/{skuId}")
    public R getSkuInfoSeckill(@PathVariable("skuId")Long skuId){
        SecKillSkuRedisTo to = seckillService.getSkuInfoSeckill(skuId);
        return R.ok().setData(to);
    }


}
